package com.july.sso.auth.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.security.Principal;

@Controller
@CrossOrigin
public class UserController {
    @GetMapping("/login")
    public String login() {
        return "login";
    }
    @GetMapping("/user")
    @ResponseBody
    public Principal getLoginUser(Principal principal) {
        return principal;
    }
}

